package com.itheima.controller;

import com.itheima.pojo.JobOption;
import com.itheima.pojo.Result;
import com.itheima.pojo.StudentCountDate;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    /**
     * 统计员工性别信息
     */
    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<Map> genderList = reportService.getEmpGenderData();
        return Result.success(genderList);
    }

    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        JobOption jobOption = reportService.getEmpJobDate();
        return Result.success(jobOption);
    }

    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeDate(){
        List<Map> list = reportService.getStudentDegreeDate();
        return Result.success(list);
    }

    @GetMapping("/studentCountData")
    public Result getstudentCountData(){
        StudentCountDate studentCountDate = reportService.getStudentDate();
        return Result.success(studentCountDate);
    }
}
